<%@page contentType="text/html; charset=UTF-8" %>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn"  uri="http://java.sun.com/jsp/jstl/functions"%>
<%@page import="java.util.regex.*"%>
<c:set var="stbNo" value="${param.stbNo}"/>
<c:set var="stbType" value="${param.stbType}"/>
<c:set var="domain" value="${param.domain}"/>

<c:if test="${not empty domain}">
	<%
		String domain = request.getParameter("domain");
		Pattern p = Pattern.compile("/EPG/jsp/(.*)/en");
		Matcher m = p.matcher(domain);
		String result = "";
		while(m.find()) {
			result = m.group(1);
		}
		request.setAttribute("epg", result);
	%>
</c:if>
<c:if test="${empty stbNo}">
	<c:set var="stbNo" value="test0001"/>
</c:if>
<c:if test="${empty stbType}">
	<c:set var="stbType" value="Ec2108"/>
</c:if>
<c:if test="${empty epg}">
	<c:set var="epg" value="defaultsmchd"/>
</c:if>
<c:set var="qrUrl" value="http://gd.weixinitv.com/wxwg/wechat/qr/code/${stbNo}/${stbType}/${epg}"/>
<html>
<head>
	<style type="text/css">
		body{
			margin: 0px;
			background-color: black;
		}
		div{
			position: absolute;
		}
		#qrCode {
			left:${(1280-430)/2}px;
			top:${(720-430)/2}px;
			width:430px;
			height:430px;
		}
		#info {
		   text-align: center;
		   left:0px;
		   top:10px;
		   height:40px;
		   width:1280px;
		   font-size:30px;
		   color:white;
		}
	</style>	
</head>
<body>	${paths }
	<div id="info">
		盒子号：${stbNo } | 型号:${stbType} | 模板:${epg}
	</div>
	<div  id="qrCode">
		<img src="${qrUrl}" width="430" height="430"/>
 	</div>
</body>
</html>
